package com.app.mapper;

import com.app.model.UserModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface UserMapper extends BaseMapper<UserModel> {
    @Select("select * from lm_user where open_id = #{openid}")
    UserModel getByOpenid(String openid);

    int getCount(UserModel model);

    List<UserModel> selectUserList(UserModel model);

    @Select("SELECT * FROM `lm_user` where village_id=#{villageId} ORDER BY integral DESC")
    List<UserModel> getIntegralList(Integer villageId);

    @Select("SELECT * FROM `lm_user` ORDER BY integral DESC")
    List<UserModel> getIntegralList();
}
